layui.define(['layer', 'tree', 'form', 'validation', 'treeSelect', 'element', 'selectPlus', 'laydate'], function (exports) {
    "use strict";
    const $ = layui.jquery,
        form = layui.form,
        validation = layui.validation,
        selectPlus = layui.selectPlus,
        laydate = layui.laydate,
        treeSelect = layui.treeSelect,
        element = layui.element,
        tree = layui.tree;
    var seleteVlue = null
    /**
     * formdata: {
     *     formparam: {
     *         style: 表单的样式属性
     *         filter: 表单的唯一标识
     *         url: 对应匹配的接口url
     *         table: 唯一表格属性，用于操作完成后的刷新等
     *         refreshHandle: 请求完成后执行相应的函数，页面的数据请求事件
     *     } //表单相关属性
     *     lables: 表单项配置
     *     otherlables：若有不同表单操作，值将lables配置替换为此配置
     *     fun：回调函数
     * }
     * btn: {
     *      modifyval: {
     *           需要的字段和值
     *           isopen:false时要修改的内容，如禁用等，值为JSON字符串 如：JSON.stringify({state: 0}).replace(/"/g, '&quot;'),
     *           删除操作时，也需要此值
     *        }
     *      ishandle: {是否操作数据库 是则往下进行 否则执行回调函数}
     *     otherform: {是否要打开另一个表单面板 本质是表单内容不同 是则将lables的值替换为otherlables}
     *     isopen: {是否打开表单面板}
     *      isajax: {是否操作接口 是则操作 否则arcgis数据}
     *     以上字段值为 true 或 不给此字段（为undefined)
     *     流程（优先级）：{
     *         otherform 是否要打开另一个表单面板  false 往下进行 判断ishandle
     *                                        true 直接打开面板 赋值表单，得到表单值，判断isajax
     *         ishandle 是否进行数据库相关操作 false 走回调函数，不再往下进行
     *                                    true 则进行下一步 判断isopen
     *         isopen 是否打开弹出的表单面板 false 必须要有modifyval，作为接口传递的参数，直接操作接口，完成return，不再往下进行
     *                                  true 则进行下一步 打开面板，赋值表单，得到表单值，判断isajax
     *         isajax 是否操作数据接口 false 执行回调函数 把已得到的表单数据返回调用处自定义使用 如arcgis数据操作等
     *                              true 往下进行
     *     }
     *     otherform:{
     *         true => ishandle:true => isopen:true => isajax:true
     *         false => isajax:true
     *     }
     *     若switch的name为state 则默认值为on 提交表单时state若为on 则为1 反之为 0
     *  }
     *
     *  callback: {
     *              回调函数 参数为一个对象
     *              是否有某一操作 若无 返回此操作false 反之 返回操作接口的类型
     *              如：
     *             callback({isopen: false, result; null, row: row}) 不打开面板，返回的结果，行数据
     *             callback({type: 'delete', result: res.data, row: row}) 操作数据接口类型，返回的结果 行数据
     *             }
     */
    /**
     let formdata = {
        btn: [
            {filter:"permissions-group-btn", modifyval: {"state": 0}, ishandle: true, isajax: true, isopen: true, subtype:"update", title:"修改", type:"button", class:"layui-btn-normal layui-btn-xs", data:rows},
            {filter:"permissions-group-btn", subtype:"delete", title:"删除", type:"button", class:"layui-btn-danger layui-btn-xs", data:rows},
            {filter:"permissions-group-btn", subtype:"authorization", title:"授权", type:"button", class:"layui-btn-danger layui-btn-xs", data:rows}
        ],
        formparam: {
            style: null,
            filter: "permissions-group-form",
            url: {update:"/group/update",delete:"/group/delete"},
            table: permissonslocaltable
        },
        lables: [
            {type:"hidden",title:"唯一标识",name:"id",placeholder:"唯一标识"},
            {type:"text",title:"权限组名称",name:"name",placeholder:"请输入权限组名称"},
            {type:"text",title:"GIS地址",name:"gisserverip",placeholder:"请输入GIS地址"},
            {type:"text",title:"服务地址",name:"diseaseserverifc",placeholder:"请输入服务地址"},
            {title:"展示模式", type:"switch", name:"state", value:"", filter:"permissions_state", text:"停用|启用"},
            {type:"text",title:"备注",name:"bz",placeholder:"请输入备注"}
        ]
    }**/
    let dictdata;
    $.ajax({
        url: "/static/js/dict.json",
        dataType: "json",
        contentType:"application/json",
        async:false,
        success: res =>{
             dictdata = res;
        }
    });
    let customform = {
        dict: function(row) {
            if(this.dict && dictdata && dictdata[this.dict[0]] && dictdata[this.dict[0]][this.dict[1]] && dictdata[this.dict[0]][this.dict[1]][row[this.field]]){
                return dictdata[this.dict[0]][this.dict[1]][row[this.field]]
            }
            return row[this.field];
        },
        init: function (data) {
            return customform.renderBtnElement(data.btn)
        },
        renderBtnElement: function (btns) {
            let btnhtml = ""
            for (let i in btns) {
                let btn = btns[i]
                let temp = ""
                for (let key in btn.events) {
                    temp += `${key}=${btn.enevts[key]}`
                }
                btnhtml += `
                            <a lay-submit 
                            class="layui-btn layui-btn-xs layui-btn-${btn.class}"
                            ${btn.name ? `name="${btn.name}"` : ''} 
                            ${btn.filter ? `lay-filter="${btn.filter}"` : ''} 
                            ${btn.subtype ? `data-subtype="${btn.subtype}"` : ''} 
                            ${btn.event ? `lay-event="${btn.event}"` : ''} 
                            ${btn.disabled ? `lay-disabled="${btn.disabled}"` : ''} 
                            ${btn.otherform ? `data-other="${btn.otherform}"` : ''} 
                            data-handle="${btn.ishandle}"
                            data-ajax="${btn.isajax}"
                            data-open="${btn.isopen}"
                            ${btn.title ? `data-title="${btn.title}"` : ''} 
                            ${btn.modifyval ? `data-modify="${btn.modifyval}"` : ''} 
                            ${temp} 
                            ${btn.data ? `data-val="${btn.data}"` : ''}                 
                            >
                                ${btn.title}
                            </a>`
            }
            return btnhtml
        },
        btnClick: function (filter, data, callback) { //普通表格
            let {formparam, lables} = data
            form.on(`submit(${filter})`, function (e) {
                formparam.filter = filter
                formparam.row = $(e.elem).attr("data-val") ? JSON.parse($(e.elem).attr("data-val")) : {}
                formparam.type = customform.hasThisValue(e.elem, "data-subtype")
                formparam.otherform = customform.hasThisValue(e.elem, "data-other")
                formparam.isopen = customform.btnDataAttr(e.elem, "data-open")
                formparam.ishandle = customform.btnDataAttr(e.elem, "data-handle")
                formparam.isajax = customform.btnDataAttr(e.elem, "data-ajax")
                formparam.modifyval = $(e.elem).attr("data-modify") ? JSON.parse($(e.elem).attr("data-modify")) : {}
                formparam.tips = customform.hasThisValue(e.elem, "data-title")
                if ($(e.elem).attr("lay-disabled") == 'disabled') return;
                if (formparam.otherform != '' && formparam.otherform != undefined) {
                    for(let key in data) {
                        if(key == formparam.otherform) {
                            data.lables = data[formparam.otherform]
                            customform.openwind(formparam, data, callback)
                            return
                        }
                    }
                }
                if (!formparam.ishandle) {
                    callback({ishandle: false, result: null, row: formparam.row})
                    return
                }
                data.lables = lables
                customform.openwind(formparam, data, callback)
            })
        },
        btnOnclick: function (filter, data, callback) { //树表格
            let {formparam, lables, otherlables} = data
            for(let n in filter){
                $("."+filter[n]).on("click",function(){
                    event.stopPropagation()
                    formparam.filter = filter[n]
                    formparam.row = $(this).attr("data-val") ? JSON.parse($(this).attr("data-val")) : {}
                    formparam.type = customform.hasThisValue(this, "data-subtype")
                    formparam.otherform = customform.hasThisValue(this, "data-other")
                    formparam.isopen = customform.btnDataAttr(this, "data-open")
                    formparam.ishandle = customform.btnDataAttr(this, "data-handle")
                    formparam.isajax = customform.btnDataAttr(this, "data-ajax")
                    formparam.modifyval = $(this).attr("data-modify") ? JSON.parse($(this).attr("data-modify")) : {}
                    formparam.tips = customform.hasThisValue(this, "data-title")
                    if ($(this).attr("lay-disabled") == 'disabled') return;
                    if (formparam.otherform != '' && formparam.otherform != undefined) {
                        for(let key in data) {
                            if(key == formparam.otherform) {
                                data.lables = data[formparam.otherform]
                                customform.openwind(formparam, data, callback)
                                return
                            }
                        }
                    }
                    if (!formparam.ishandle) {
                        callback({ishandle: false, result: null, row: formparam.row})
                        return
                    }
                    data.lables = lables
                    customform.openwind(formparam, data, callback)
                })
            }
        },
        hasThisValue: function (el, attr) {
            return $(el).attr(attr) ? $(el).attr(attr) : null
        },
        btnDataAttr: function (el, attr) {
            return $(el).attr(attr) == 'false' ? false : true
        },
        openwind: function (formparam, datas, callback) {
            let {lables} = datas
            let {row, tips, modifyval} = formparam
            if (!formparam.isopen) {
                if(formparam.type == 'delete' && (row.children && row.children.length > 0)) {
                    layer.msg(row.name + '下有子级，需要先删除子级', {icon: 0, offset: '10px'})
                    return;
                }
                layer.msg(`确定${tips}此项？`, {
                    time: 20000,
                    btn: ['确定', '取消'],
                    yes: function (index) {
                        apiRequestCru({
                            url: formparam.url[formparam.type],
                            params: formparam.modifyval
                        }).then(res => {
                            if (res.code == 200) {
                                callback({type: formparam.type, result: res.data, row: row})
                                layer.msg(`${tips}成功！`, {icon: 1, offset: '10px'})
                                formparam.refreshHandle ? formparam.refreshHandle() : formparam.table.reload()
                            } else {
                                layer.msg(res.description, {icon: 2, offset: '10px'})
                            }
                            layer.close(index)
                        }).catch(err => {
                            layer.msg(err, {icon: 2, offset: '10px'})
                            layer.close(index)
                        })

                    }
                })
                return
            }
            layer.open({
                type: 1,
                title: false,
                closeBtn: false,
                area: '600px',
                shade: 0,
                id: formparam.filter + '-lay', //设定一个id，防止重复弹出
                btn: ['确认', '取消'],
                btnAlign: 'c',
                moveType: 0, //拖拽模式，0或者1
                content: customform.render(formparam, lables),
                success: function () {
                    if($('#layui-custom-form').height() > 360) {
                        $('#layui-custom-form').css('overflow-y', 'scroll')
                        $('#layui-custom-form').css('max-height', '360px')
                    }
                    form.render()
                    customform.renderCustomComp(lables)
                    if(formparam.type == 'insert') {
                        if(row.hasOwnProperty('code')) {
                            row.parentname = row.name
                            form.val(formparam.filter + '-example', {parentname: row.parentname});
                        } else {
                            row.parentname = row.name || row.title
                            form.val(formparam.filter + '-example', {parentname: row.parentname});
                        }
                    }
                    if (formparam.type == "update") {
                        if (row.hasOwnProperty('state')) {
                            row.state == '1' ? row.state = 'on' : row.state = ''
                        }
                        row.parentname = row.parentname || row.parentid || row.parentcode
                        form.val(formparam.filter + '-example', row);
                    }
                },
                yes: function (index) {

                    let formdata = form.val(formparam.filter + '-example')
                    if (!customform.virifyForm(formdata)) return;
                    if (row.hasOwnProperty('state') || formdata.hasOwnProperty('state')) {
                        formdata.state = formdata.state && formdata.state == 'on' ? 1 : 0
                    }

                    if(formdata.hasOwnProperty('keytext')) {
                        var obj = seleteVlue.getChecked().data
                        let names = []
                        for(let i in obj) {
                            names.push(obj[i].name)
                        }
                        formdata.keytext = names.join(',')
                    }
                    if(formparam.type == 'insert') {
                        if(row.hasOwnProperty('code')) {
                            formdata.parentcode = row.code
                            formdata.parentname = row.name
                        }
                        if(row.hasOwnProperty('uuid')) {
                            if((row.uuid+"").indexOf("group_")>=0){
                                formdata.groupid = (row.uuid+"").replace("group_","");
                                formdata.parentid="0";
                            } else {
                                formdata.groupid = row.groupid;
                            }
                        } else {
                            formdata.parentid = row.uuid || row.id || 0
                        }
                        if(row.hasOwnProperty('classid')) {
                            formdata.classid = row.classid
                        }

                    }
                    if (formparam.injection && formparam.injection.length > 0) {
                        let injection = formparam.injection
                        for (let i in injection) {
                            if(injection[i].btn == formparam.filter) {
                                if(injection[i].required) {
                                    let param = $("input[name='" + injection[i].name + "']").val();
                                    if(param != '' && param != undefined) {
                                        formdata[injection[i]] = param;
                                    } else {
                                        layer.msg(injection[i].tips, {icon: 2, offset: '10px'})
                                        return
                                    }
                                } else {
                                    let param = $("input[name='" + injection[i].name + "']").val();
                                    formdata[injection[i]] = param;
                                }
                            }
                        }
                    }
                    if (!formparam.isajax) {
                        callback({isajax: false, result: formdata, row: row})
                        layer.close(index)
                        return
                    }
                    apiRequestCru({
                        url: formparam.url[formparam.type],
                        params: formdata
                    }).then(function (e) {
                        if (e.code == 200) {
                            callback({type: formparam.type, result: e.data, row: row})
                            layer.msg(`${tips}成功!`, {icon: 1, offset: '10px'})
                            formparam.refreshHandle ? formparam.refreshHandle() : formparam.table.reload()
                            seleteVlue = null
                        } else {
                            layer.msg(e.description, {icon: 2, offset: '10px'})
                        }
                        layer.close(index)
                    }).catch(err => {
                        layer.msg(err, {icon: 2, offset: '10px'})
                        layer.close(index)
                    })
                }
            })
        },
        virifyForm: function (formdata) {
            let bj = false;
            for (let key in formdata) {
                let verify = $("[name='" + key + "']").attr("lay-verify");
                if (verify != '' && verify != undefined && verify != "undefined") {
                    let title = $("[name='" + key + "']").parent().parent().children(":first").text();
                    let flag = validation.init(title, verify, formdata[key]);
                    if (!flag) {
                        $("[name='" + key + "']").css("border", "2px solid red");
                        $("[name='" + key + "']").focus(function () {
                            $("[name='" + key + "']").css("border", "0");
                        });
                        return false;
                    } else {
                        bj = true;
                    }
                } else {
                    bj = true;
                }
            }
            return bj;
        },
        selectTree: function (options) {
            function calleArr(array,idName){
                let uuids = [];
                for(let i in array){
                    let data = array[i];
                    if(data.children){
                        uuids.push(data[options.idName]);
                        uuids.push.apply(uuids,calleArr(data.children)); //自己调用自己
                    }else{
                        uuids.push(data[options.idName]);
                    }
                }
                return uuids;
            }
            function formatdata(data, options){
                return data.filter(father => {
                    father.title = father[options.title];
                    let branchArr = data.filter(child => father[options.idName] === child[options.pidName]);
                    branchArr.length > 0 ? (father.children = branchArr) : "";
                    return father[options.pidName] == options.pidVal; // 如果第一层不是parentId=0，请自行修改
                });
            }
            apiRequest({url:options.url,params: options.where}).then(function(e){
                if(e.code == 200){
                    let data = formatdata(e.data,options);
                    tree.render({
                        elem: "#"+options.elem+"-tree", //指定元素
                        data: data,
                        click: function(node) { //点击节点回调
                            let othis = $($(this)[0].elem).parents(".layui-form-select");
                            othis.removeClass("layui-form-selected").find(".layui-select-title span").
                            html(node.data[options.title]).end().find("input:hidden[name='"+options.elem+"']").val(node.data[options.idName]);
                            let params = {};
                            if(options.isChildren){
                                let arr = calleArr([node.data],options.idName);
                                params[options.elem] = "'" + arr.join("','") + "'";
                            } else {
                                params[options.elem] = node.data[options.idName];
                            }
                            options.click(params);
                        }
                    });
                    $("."+options.elem).on("click", ".layui-select-title", function(e) {
                        $(".layui-form-select").not($(this).parents(".layui-form-select")).removeClass("layui-form-selected");
                        $(this).parents("."+options.elem).toggleClass("layui-form-selected");
                        layui.stope(e);
                    }).on("click", "dl i", function(e) {
                        layui.stope(e);
                    });
                } else {
                    layer.msg(e.description, {icon: 2, offset: '10px'})
                }
            })
        },
        render: function (formparam, lables) {
            function appendHtml(title, tempHtml) {
                let temp = "<div class=\"layui-form-item\">";
                temp += "<label class=\"layui-form-label\">" + title + "</label>";
                temp += "<div class=\"layui-input-block\">" + tempHtml + "</div>";
                temp += "</div>";
                return temp;
            }

            let formstyle = "";
            for (let key in formparam.style) {
                formstyle += key + ":" + formparam.style[key] + ";";
            }
            let html = `<div class="layui-form" id="layui-custom-form">`
            html += "<form class=\"layui-form\" lay-filter=\"" + formparam.filter + "-example\" style=\"padding: 20px 20px 0 0;" + formstyle + "\">";
            for (let i in lables) {
                /**
                 form：{
                     type:""+subtype+"",//表单提交类型
                     style:{
                         overflow:"hidden"
                     },//自定义样式
                     filter:"layer_map_form"//唯一标识
                 };
                 **/
                let lable = lables[i];
                let tempHtml = "";
                /** {title:"",type:"",name:"",verify:"",placeholder:"",value:"",disabled:""} */
                if (lable.type == 'hidden') {
                    tempHtml = "<input type=\"hidden\" name=\"" + lable.name + "\" value=\"" + lable.value + "\" autocomplete=\"off\" placeholder=\"" + lable.placeholder + "\" class=\"layui-input\" " + (lable.hasOwnProperty("verify") ? "lay-verify=\"" + lable.verify + "\"" : "") + " " + (lable.hasOwnProperty("disabled") ? "disabled" : "") + ">";
                }
                /** {title:"",type:"",name:"",verify:"",placeholder:"",value:"",disabled:""} */
                if (lable.type == 'text') {
                    tempHtml = "<input type=\"text\" name=\"" + lable.name + "\" lay-verify=\"" + lable.verify + "\" autocomplete=\"off\" placeholder=\"" + lable.placeholder + "\" class=\"layui-input\" " + (lable.hasOwnProperty("verify") ? "lay-verify=\"" + lable.verify + "\"" : "") + " " + (lable.hasOwnProperty("disabled") ? "disabled" : "") + ">";
                }
                /** 时间选择器：{title:"xxx",type:"date",placeholder:"",} **/
                if (lable.type == 'date') {
                    tempHtml = `<input type="text" name="${lable.name}" id="${lable.name}" lay-verify="date" placeholder="${lable.placeholder}" autoComplete="off" class="layui-input">`
                }
                /** 下拉多选组件（非树）{title: "xx",type:"checkgroup",data:[{name: 'xx', title: 'xx', id: x},{...}]} **/
                if (lable.type == 'checkgroup') {
                    tempHtml = ` <div id="${lable.name}" class="layui-input" style="padding: 0 !important;">
                        <input type="hidden" type="text" name="${lable.name}" value="" id="${lable.name}" lay-filter="${lable.name}" autoComplete="off" class="layui-input">
                    </div>`
                }
                /** 下拉多选人员/单选单位树组件 {title:"xx",type:"treeuser/treedanwei",name:"xx",} **/
                if (lable.type == 'selecttree') {
                    tempHtml = `<div class="layui-unselect layui-form-select ${lable.name}">`;
                    tempHtml += `<div class="layui-select-title">`;
                    tempHtml += `<span class="layui-input layui-unselect">${lable.placeholder}</span>`;
                    tempHtml += `<input type="hidden" name="${lable.name}">`;
                    tempHtml += `<i class="layui-edge"></i>`;
                    tempHtml += `</div>`;
                    tempHtml += `<dl class="layui-anim layui-anim-upbit">`;
                    tempHtml += `<dd>`;
                    tempHtml += `<ul id="${lable.name}-tree"></ul>`;
                    tempHtml += `</dd>`;
                    tempHtml += `</dl>`;
                    tempHtml += `</div>`
                }
                /** 下拉多选人员/单选单位树组件 {title:"xx",type:"treeuser/treedanwei",name:"xx",} **/
                if (lable.type == 'treeuser' || lable.type == 'treedanwei') {
                    tempHtml = `<input type="text" name="${lable.name}" id="${lable.name}" lay-filter="${lable.name}" class="layui-input">`
                }
                /** {title:"",type:"",title:"",data:[{width:"",name:"",filter:"",placeholder:"",verify:""}]} */
                if (lable.type == 'text-pro') {
                    tempHtml = "<div class=\"layui-form-item\">";
                    tempHtml += "<label class=\"layui-form-label\">" + lable.title + "</label>";
                    for (let o in lable.data) {
                        tempHtml += "<div class=\"layui-input-inline\" style=\"width: " + lable.data[o].width + "px;\">";
                        tempHtml += "<input type=\"text\" name=\"" + lable.data[o].name + "\"  lay-filter=\"" + lable.filter + "\" placeholder=\"" + lable.data[o].placeholder + "\" autocomplete=\"off\" class=\"layui-input\" " + (lable.data[o].hasOwnProperty("verify") ? "lay-verify=\"" + lable.data[o].verify + "\"" : "") + ">";
                        tempHtml += "</div>";
                    }
                    tempHtml += "</div>";
                }
                /** {title:"",type:"",name:"",filter:"",verify:"",search:"",placeholder:"",data:[{value:"",title:""}]} */
                if (lable.type == 'select') {
                    tempHtml = "<select name=\"" + lable.name + "\" lay-filter=\"" + lable.filter + "\" " + (lable.hasOwnProperty("verify") ? "lay-verify=\"" + lable.verify + "\"" : "") + " lay-search=\"" + lable.search + "\">";
                    tempHtml += "<option value=\"\">" + lable.placeholder + "</option>";
                    for (let o in lable.data) {
                        tempHtml += "<option value=\"" + lable.data[o].value + "\">" + lable.data[o].title + "</option>";
                    }
                    tempHtml += "</select>";
                }
                /** {title:"",type:"",data:[{name:"",filter:"",value:"",title:"",checked:"",disabled:""}]} */
                if (lable.type == 'radio') {
                    for (let o in lable.data) {
                        tempHtml += "<input type=\"radio\" name=\"" + lable.data[o].name + "\" lay-filter=\"" + lable.data[o].filter + "\" value=\"" + lable.data[o].value + "\" title=\"" + lable.data[o].title + "\" " + (lable.data[o].hasOwnProperty("checked") ? "checked" : "") + " " + (lable.data[o].hasOwnProperty("disabled") ? "disabled" : "") + ">";
                    }
                }
                /** {title:"",type:"",data:[{name:"",filter:"",title:"",checked:"",disabled:""}]} */
                if (lable.type == 'checkbox') {
                    for (let o in lable.data) {
                        tempHtml += "<input type=\"checkbox\" name=\"" + lable.data[o].name + "\" lay-skin=\"primary\" lay-filter=\"" + lable.data[o].filter + "\" title=\"" + lable.data[o].title + "\" " + (lable.data[o].hasOwnProperty("checked") ? "checked" : "") + " " + (lable.data[o].hasOwnProperty("disabled") ? "disabled" : "") + ">";
                    }
                }
                /** {title:"",type:"",name:"",value:"",skin:"",filter:"",text:"",checked:""} */
                if (lable.type == 'switch') {
                    tempHtml = "<input type=\"checkbox\" name=\"" + lable.name + "\" value=\"" + lable.value + "\" lay-skin=\"switch\" lay-filter=\"" + lable.filter + "\" lay-text=\"" + lable.text + "\" "+(lable.checked?lable.checked:"")+">";
                }
                /** {title:"",type:"",name:"",placeholder:""} */
                if (lable.type == 'textarea') {
                    tempHtml = "<textarea name=\"" + lable.name + "\" placeholder=\"" + lable.placeholder + "\" class=\"layui-textarea\"></textarea>";
                }
                if (lable.type != 'hidden' && lable.type != 'text-pro' && tempHtml.length > 0) {
                    tempHtml = appendHtml(lable.title, tempHtml);
                }
                html += tempHtml;
            }
            return html + "</form></div>";
        },
        renderCustomComp: function (lab) {
            for (let i in lab) {
                if (lab[i].type == 'date') {
                    laydate.render({
                        elem: `#${lab[i].name}`,
                        value: lab[i].value
                    });
                }
                if (lab[i].type == 'checkgroup') {
                    seleteVlue = selectPlus.render({
                        el: `#${lab[i].name}`,
                        data: lab[i].data,
                        valueSeparator: ' / ',
                        values: lab[i].value.split(',')
                    })
                }
            }
            element.init();
        }
    }
    exports('customform', customform)
});